package com.lindroy.androidplayer.viewmodels

import com.lindroy.androidplayer.logic.model.KnowledgeItemResp
import com.lindroy.androidplayer.logic.model.bean.TabBean
import com.lindroy.androidplayer.utils.SingleLiveEvent

/**
 * @author Lin
 * @date 2022/1/24
 * @function
 */
data class KnowledgeSystemViewModel(
    val id: Int,
    val name: String,
    val items: List<KnowledgeItemResp>,
    val itemClickAction: SingleLiveEvent<List<TabBean>>,
    val childItemClickAction: SingleLiveEvent<List<TabBean>>
) {
    fun onItemClick() {
        itemClickAction.postValue(items.map { TabBean(it.id, it.name, false, id, name) })
    }
}
